﻿#include "plcthread.h"

PlcThread::PlcThread(QObject *parent) : QObject(parent)
{
	m_worker = new PlcWorker();
	m_worker->moveToThread(&m_workThread);
	connect(this, &PlcThread::sigInitialize, m_worker, &PlcWorker::Initialize);
	connect(this, &PlcThread::sigStart, m_worker, &PlcWorker::start);
	connect(&m_workThread, &QThread::finished, m_worker, &QObject::deleteLater);
	m_workThread.start();
}

PlcThread::~PlcThread()
{

}

void PlcThread::Initialize()
{
	emit sigInitialize();
}

void PlcThread::start()
{
	emit sigStart();
}
